package com.xin.di.uav.common.request;

import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class CreateWaybillRequest {

    @NotBlank(message = "开发者账号不能为空")
    private String devCode;

    @NotBlank(message = "推单时间不能为空")
    @Pattern(regexp = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}", message = "推单时间格式必须为 yyyy-MM-dd HH:mm:ss")
    private String pushTime;

    @NotNull(message = "是否使用接驳柜不能为空")
    @Min(value = 1, message = "是否使用接驳柜必须为1或2")
    @Max(value = 2, message = "是否使用接驳柜必须为1或2")
    private Integer useCab;

    private String boxCode;

    @NotBlank(message = "客户订单号不能为空")
    private String bizCode;

    @NotNull(message = "坐标系类型不能为空")
    @Min(value = 1, message = "坐标系类型必须为1")
    @Max(value = 1, message = "坐标系类型必须为1")
    private Integer gpsType;

    @NotBlank(message = "寄件人航站编码不能为空")
    private String senderCode;

    @NotBlank(message = "寄件人地址经度不能为空")
    @Pattern(regexp = "-?\\d+(\\.\\d+)?", message = "寄件人地址经度格式不正确")
    private String senderLon;

    @NotBlank(message = "寄件人地址纬度不能为空")
    @Pattern(regexp = "-?\\d+(\\.\\d+)?", message = "寄件人地址纬度格式不正确")
    private String senderLat;

    @NotBlank(message = "寄件人详细地址不能为空")
    private String senderAddr;

    @NotBlank(message = "寄件人电话不能为空")
    @Pattern(regexp = "1[3-9]\\d{9}", message = "寄件人电话格式不正确")
    private String senderTel;

    @NotBlank(message = "寄件人姓名不能为空")
    private String senderName;

    @NotNull(message = "货物类型不能为空")
    private Integer goodsType;

    @NotNull(message = "货物重量不能为空")
    @Min(value = 1, message = "货物重量必须大于0")
    private Integer goodsWeight;

    @NotBlank(message = "收件人航站编码不能为空")
    private String receiverCode;

    @NotBlank(message = "收件人地址经度不能为空")
    @Pattern(regexp = "-?\\d+(\\.\\d+)?", message = "收件人地址经度格式不正确")
    private String receiverLon;

    @NotBlank(message = "收件人地址纬度不能为空")
    @Pattern(regexp = "-?\\d+(\\.\\d+)?", message = "收件人地址纬度格式不正确")
    private String receiverLat;

    @NotBlank(message = "收件人详细地址不能为空")
    private String receiverAddr;

    @NotBlank(message = "收件人电话不能为空")
    @Pattern(regexp = "1[3-9]\\d{9}", message = "收件人电话格式不正确")
    private String receiverTel;

    @NotBlank(message = "收件人姓名不能为空")
    private String receiverName;

    @DecimalMin(value = "0.0", message = "订单金额不能为负数")
    private Double amount;

    private String goodsCode;

    private String remark;
}
